﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="RequestTableMaint.aspx.cs" Inherits="yellig.Pages.Request.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Applications
    </h2>
    <p>
        Request !t - Request Table
        <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false" IncludeStyleBlock="false" Orientation="Horizontal">
            <Items>
                <asp:MenuItem NavigateUrl="~/Pages/Request/RequestTableMaint.aspx" Text="Request"/>
                <asp:MenuItem NavigateUrl="~/Pages/Request/RequestTypeTableMaint.aspx" Text="Request Type"/>
                <asp:MenuItem NavigateUrl="~/Pages/Request/RequestOwnerTableMaint.aspx" Text="Request Owner"/>
             </Items>
        </asp:Menu>
    </p>
    <p>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="Id" SortExpression="Id" 
                    InsertVisible="False" ReadOnly="True" />
                <asp:BoundField DataField="RequestType" HeaderText="RequestType" 
                    SortExpression="RequestType" />
                <asp:BoundField DataField="RequestStatus" HeaderText="RequestStatus" 
                    SortExpression="RequestStatus" />
                <asp:BoundField DataField="Description" HeaderText="Description" 
                    SortExpression="Description" />
                <asp:BoundField DataField="Details" HeaderText="Details" 
                    SortExpression="Details" />
                <asp:BoundField DataField="SubmittedBy" HeaderText="SubmittedBy" 
                    SortExpression="SubmittedBy" />
                <asp:CommandField ShowEditButton="True" />
                <asp:CommandField ShowDeleteButton="True" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:yellig_db_local %>" 
            SelectCommand="SELECT * FROM [app_Request]"
            InsertCommand="INSERT INTO app_Request (RequestType,RequestStatus,Description,Details,SubmittedBy) VALUES (@RequestType,@RequestStatus,@Description,@Details,@SubmittedBy)" 
            DeleteCommand="DELETE FROM [app_Request]" 
            UpdateCommand="UPDATE app_Request set RequestType=@RequestType, RequestStatus=@RequestStatus, Description=@Description, Details=@Details, SubmittedBy=@SubmittedBy " >
            <insertparameters>
                <asp:formparameter name="RequestType" formfield="RequestType" />
                <asp:formparameter name="RequestStatus" formfield="RequestStatus" />
                <asp:formparameter name="Description" formfield="Description" />
                <asp:formparameter name="Details" formfield="Details" />
                <asp:formparameter name="SubmittedBy" formfield="SubmittedBy" />
            </insertparameters>           
            <UpdateParameters>
                <asp:Parameter Name="RequestType" />
                <asp:Parameter Name="RequestStatus" />
                <asp:Parameter Name="Description" />
                <asp:Parameter Name="Details" />
                <asp:Parameter Name="SubmittedBy" />
            </UpdateParameters>
        </asp:SqlDataSource>
 </asp:Content>
